package com.czy.fx.day1.stage;

import javafx.application.Application;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
import javafx.geometry.Rectangle2D;
import javafx.stage.Screen;
import javafx.stage.Stage;

/**
 * Screen
 */
public class demo6 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Platform");

        Screen screen = Screen.getPrimary();
        System.out.println(screen);
        System.out.println("当前屏幕像素点："+screen.getDpi());
        //Bounds 是整个屏幕信息，
        Rectangle2D bounds = screen.getBounds();
        double width = bounds.getWidth();
        double height = bounds.getHeight();
        System.out.println("宽度："+width+" 高度："+height);

        /*VisualBounds是除任务栏以外区域信息*/
        Rectangle2D vBounds = screen.getVisualBounds();
        double vWidth = vBounds.getWidth();
        double vHeight = vBounds.getHeight();
        System.out.println("宽度："+vWidth+" 高度："+vHeight);

        primaryStage.show();

    }
}